<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="sass/jobcalendar.css"/>
</head>
<body>
    <div>
        <input type="text" class="jobcalendar" id="calendar1"
               data-lang="zh-CN" data-has-to-now="false" data-start-year="1990" data-end-year="2015" />
    </div>
    <input type="text" id="calendar2"
           data-lang="en-US" data-has-to-now="true" data-start-year="1990" data-end-year="2015" />
</body>
<script src="ts/jobcalendar.js"></script>
<script>
    var input1 = document.getElementById("calendar1");
    var input2 = document.getElementById("calendar2");
    var calendar = JobCalendar.getInstance();
    calendar.updateOption({lang:"zh-CN",hasToNow:true,startYear:1990,endYear:2015, startEnabled:199504, endEnabled:200011});

    calendar.addBindingElement(input1,function(){
        console.log("here is callback function for calendar1");
        input2.setAttribute("data-start-enabled",input1.value);
    });

    calendar.addBindingElement(input2);

//    calendar.removeBindingElement(input2);
</script>
</html>